public class Tree {
    public static void main(String[] args) {
        TestBinaryTree testBinaryTree=new TestBinaryTree();
        TestBinaryTree.TreeNode root=testBinaryTree.createTree();
        testBinaryTree.preOrder(root);
        System.out.println();

        testBinaryTree.inOrder(root);
        System.out.println();

//        System.out.println(testBinaryTree.size(root));

        testBinaryTree.size2(root);
        System.out.println(TestBinaryTree.nodeSize);

        System.out.println("======叶子结点的个数=====");
        System.out.println(testBinaryTree.getLeafNodeCount(root));

        testBinaryTree.getLeafCount2(root);
        System.out.println(testBinaryTree.leafCount);

        System.out.println("========第k层节点的个数======");
        System.out.println(testBinaryTree.getKLevelNodeCount(root, 3));

        System.out.println("========求树的高度======");
        int height= testBinaryTree.getHeight(root);
        System.out.println(height);

        System.out.println("========查找某个值======");
        TestBinaryTree.TreeNode ret=testBinaryTree.find(root,'I');
        System.out.println(ret.val);

    }
}
